def main():
    # string_whether_in()
    judge_type()


def string_whether_in():
    # 判断字符是否在字符串中返回位置索引,find和index
    s = "学习框架构建理解实践操作学习"
    i = s.find("理解")
    i1 = s.index("学")
    # 判断字符串在字符串中的个数
    i2 = s.count("学习")
    rfind = s.rfind("学习")
    print(rfind)
    # 判断字符串是否在字符串中
    if "框架" in s:
        print(True)
    # 判断是否是某个字符串开头或者结尾
    start = s.startswith(("学习", "框架"))
    print(start)


def judge_type():
    # 判断数字和字母
    s = "框架飞飞飞"
    isdecimal = s.isdecimal()
    s1 = s.isdigit()
    print(s1)
    s2 = s.isalpha()
    print(s2)
    s3 = "w23开"
    s3 = s3.isalnum()
    print(s3)
    # 判断字符是否是字母大小写
    s4= "aaaa啊123"
    s4 = s4.islower()
    print(s4)
    s5 = "框架framework"
    s5 = s5.istitle()
    print(s5)
    # 判断空格，标识符，可打印字符
    s6 = "框架理解练习"
    s6 = s6.isprintable()
    print(s6)


if __name__ == '__main__':
    main()
